home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** File: Start.c
- ** Written by Eric Soldan
- **
- ** Copyright © 1989-1992 Apple Computer, Inc.
- ** All rights reserved.
- */
-
-
-
- /*****************************************************************************/
-
-
-
- #define declare_main_structs
-
- #include "App.h" /* Get the application includes/typedefs, etc. */
- #include "App.Common.h" /* Get the stuff in common with rez. */
- #include "App.protos.h" /* Get the prototypes for the application. */
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
-
-
- /*****************************************************************************/
-
-
-
- #ifndef THINK_C
- extern void _DataInit();
- #endif
-
-
-
- /*****************************************************************************/
- /*****************************************************************************/
-
-
-
- #pragma segment Main
- void main(void)
- {
- #ifndef THINK_C
- UnloadSeg((Ptr)_DataInit); /* Note that _DataInit can't be in Main! */
- #endif
-
- SetApplLimit(GetApplLimit() - 16384);
- /* This decreases the application heap by 16k, which in turn
- ** increases the stack by 16k. */
-
- MaxApplZone(); /* Expand the heap so code segments load at the top. */
-
- Initialize(1, kMinHeap, kMinSpace, nil, nil); /* Initialize the program. */
- DoSetResCursor(watchCursor); /* Rest of startup may take a while. */
- InitRequiredAppleEvents();
- DoAdjustMenus();
-
- OpenToolPalette(); /* Create the palette window. */
- OpenClipboard(); /* Create clipboard document. */
- StartDocuments(); /* Open (or print) designated documents. */
-
- UnloadSeg((Ptr)Initialize); /* Initialize can't be in Main! */
- EventLoop(); /* Call the main event loop. */
- ExitToShell(); /* Quit the application. */
- }
-
-
-
-